<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据库后台</title>
    <script src="../js/angular1.6.0.js"></script>
    <script src="../js/angular-route.js"></script>
    <link href="../css/register.wap.css" rel="stylesheet">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <script src="../js/jquery.min.js"></script>
    <script src="../js/bootstrap.min.js"></script>
<!--    <script src="../js/main.js"></script>-->
<!--    <script src="../js/registerController.js"></script>-->
</head>
<body background="../img/bg.jpg" style="background-size:100% 80%;background-attachment:fixed;"style="width: 100% ; height: 100%">
<div class="mydiv" style="width: 100% ">
    <div class="tab-pane fade in active" style="width: 100% ">
        <div class="reg container ng-scope"  style="width: 100% ">
            <p class="tanc_tl" style="width: 100% ">
                数据库后台
            </p>
            <p class="tanc_tl_small" style="width: 100% ">
                登录
            </p>
            <div class="reg_main" style="width: 100% ">
                <div class="login_gp" style="width: 100% ">
                    <input type="text" class="form-control ng-pristine ng-untouched ng-valid ng-empty"
                           id="loginname"
                            placeholder="请输入您的账号" style="width: 100% ">
                </div>

                <!-- 登录密码 -->
                <div class="login_gp" style="width: 100% ">
                    <input type="password" placeholder="请输入您的登录密码"
                           class="form-control ng-pristine ng-untouched ng-valid ng-empty" id="password"
                            name="password" style="width: 100% ">
                </div>

<!--                <p class="erro ng-binding" style="height:17px"></p>-->
                <!-- 完成 -->
<!--                <a href="register.html">没有账号，前往注册</a>-->
<!--                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
<!--                <a href="resetPassword.html">忘记密码</a>-->
                <br><br>
                <input id = "loginsubmit"  type="button" class="login_btn ng-pristine ng-untouched ng-valid ng-empty" value="登录" style="width: 100% ">
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">

    $(document).ready(function () {

    $("#loginsubmit").click(function () {

        if (!$("#loginname").val().length==0&&!$("#password").val().length==0) {
            let d1 = {
                userName: $("#loginname").val(),
                password: $("#password").val(),
            };
            $.ajax({
                type: "POST",
                url: "../login/judge",
                contentType: "application/json;charset=utf-8",
                data:JSON.stringify(d1),
                dataType: "json",
                success:function (data) {
                    window.location.href= "/msgtable/wap/formsubmit.html"
                    // alert("提交成功"+JSON.stringify(message));
                },
                error:function (data) {
                    alert("账号或密码错误")
                }
            });


        } else {
            alert("请输入账号或者密码")
        }
    });
    });

</script>






</body>
</html>
